//=============================================================================
// Claw Fire
//=============================================================================
class ClawFire extends ChaosWeaponProjectileFire;

// sounds
var sound Proxylauncher_fire[12];

// This function will disallow at the playing of the client side animation during a reload
simulated function bool AllowFire()
{
	return Super.AllowFire() && !ChaosWeapon(Weapon).bPlayChangeAmmo;
}

function StartBerserk()
{
	FireRate = default.FireRate * 0.75;
	FireAnimRate = default.FireAnimRate / 0.75;
}

function ServerPlayFiring()
{
	if (!TFClaw(Weapon).bCanPlayFiringAnim)
		return;
	 if (ProjectileClass==class'ClawFiremineProj')
		Weapon.PlayOwnedSound(Sound'TFMedia.Lasermine.lasermine_singlefire',SLOT_Interact,TransientSoundVolume,,,,false);
}

function PlayFiring()
{
	if (!TFClaw(Weapon).bCanPlayFiringAnim)
		return;
	if (FireCount > 0)
    {
		if (Weapon.HasAnim(FireLoopAnim))
			Weapon.PlayAnim(FireLoopAnim, FireLoopAnimRate, 0.0);
		else
			Weapon.PlayAnim(FireAnim, FireAnimRate, TweenTime);
	}
	else
		Weapon.PlayAnim(FireAnim, FireAnimRate, TweenTime);

	if ( ChaosWeapon(weapon).SoundCount == 0)
		Weapon.PlayOwnedSound(Sound'TFMedia.Lasermine.lasermine_singlefire',SLOT_Interact,TransientSoundVolume,,,,false);

	ClientPlayForceFeedback(FireForce);  // jdf
	FireCount++;
}

//-----------------------------------------------------------------------------
// ChangeMode
//	Switches firing mode to match weapon's ammo type.
//-----------------------------------------------------------------------------
function ChangeMode(byte MyCount) {
	Switch (MyCount) {
		case 0:
			ProjectileClass=class'ClawFiremineProj';
			ProjSpawnOffset.X=20;
			ProjSpawnOffset.Y=9;
			ProjPerFire=1;
			BotRefireRate=1;
			bRecommendSplashDamage=false;
			bSplashDamage=false;
			bTossed=false;
			TFClaw(Weapon).bCanPlayFiringAnim=true;
			break;
	}
}



//============================================================================
// Pause
// Cheap hack to avoid firing off another proxy...
//============================================================================
state Pause
{
      event ModeDoFire(){}
      simulated function Timer()
      {
          GotoState('');
      }
      simulated function BeginState()
      {
         TFClaw(Weapon).bCanPlayFiringAnim=false;
         SetTimer(0.5, false);
      }
      simulated function EndState()
      {
         TFClaw(Weapon).bCanPlayFiringAnim=True;
      }
}

defaultproperties
{
     ProjSpawnOffset=(X=20.000000,Y=9.000000,Z=-6.000000)
     FireAnimRate=1.500000
     FireRate=1.000000
     AmmoPerFire=1
     ShakeRotMag=(X=70.000000)
     ShakeRotRate=(X=1000.000000)
     ShakeRotTime=1.800000
     ShakeOffsetMag=(Z=-2.000000)
     ShakeOffsetRate=(Z=1000.000000)
     ShakeOffsetTime=1.800000
     Spread=600.000000
     SpreadStyle=SS_Random
}
